home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)abi.d64
/
car cost_mile
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
6KB
|
209 lines
2 GOSUB2000:PRINT" CAR FINANCIAL";""
3 PRINT"THIS PROGRAM CALCULATES THE ACTUAL"
4 PRINT"COSTS OF A CAR IN COSTS PER MILE."
6 PRINT"PURCHASE AND BUYING ON TIME ARE"
7 PRINT"CONSIDERED. THE PROGRAM CONSIDERS"
8 PRINT"FINANCE CHARGES, OIL CONSUMPTION,"
9 PRINT"TIRE & GAS COSTS, MAINTENANCE COSTS,
10 [153]"PLANED USE,AND USEFUL LIFE."
14 [133]"ARE YOU READY (YES/SAMPLE INPUT=1)";V$
16 [139] V$[178]"1" [167] 1000
18 [156]
19 XX[178]1
20 [133] "LOADWHO IS THE CAR MANUFACTURER....";A$
40 [153] "LOADWHAT IS THE YEAR OF THE CAR....":[133] C$
60 [153] "LOADWHAT IS THE PURCHASE COST OF THE CAR....":[133] E
70 [153] "LOADINPUT THE ESTIMATED YEARS OF (USE,LIFE) ....":[133] F,UL
80 [153]"LOADWHAT IS YOUR ESTIMATED COST OF GAS IN $/GALLON...":[133]G
90 [153]"LOADWHAT IS YOUR ESTIMATED COST OF OIL PER QUART....":[133] H
100 [153]"LOADWHAT IS YOUR ESTIMATED TIRE COST PER TIRE..":[133]I
110 [153]"LOADWHAT IS YOUR ESTIMATED NUMBER OF DRIVING MILES PER YEAR...":[133]J
120 [153]"LOADWHAT IS THE ESTIMATED TIRE LIFE IN MILES...":[133] K
130 [153]"LOADWHAT IS YOUR ESTIMATED COST OF COLLISION INSURANCE PER YEAR..."
132 [133]L
146 [133]"LOADAMOUNT TO BE FINANCED";AF:[133]"LOADYEARS OVER WHICH FINANCED";YF
147 [133]"LOADESTIMATED INT. RATE APR%....";I(2):I(2)[178]I(2)[172].01
148 [133]"LOADMPG RATING (CITY,HIWAY)...";M,N
149 [133]"LOAD% HIWAY DRIVING....";O
150 [153]"LOADTHIS TERMINATES THE INPUT PHASE OF THE "
151 [153]"PROGRAM.......HERE IS A SUMMARY!
160 Z=TI
170 IF (TI-Z)<300 THEN 170
171 PRINT"[147]";SPC(10);"INPUT PARAMETERS";""
180 PRINT "MANUFACTURER.....";A$
181 PRINT "MODEL............";B$
182 PRINT "CAR YEAR.........";C$
184 PRINT "PURCHASE PRICE...";E
185 PRINT "YEARS OF USE,LIFE";F;",";UL
186 PRINT "GAS PRICE........";G
187 PRINT "OIL PRICE........";H
188 PRINT "TIRE COST........";I
189 PRINT "TIRE LIFE........";K
190 PRINT "MILES/YEAR.......";J
191 PRINT "INSURANCE COST...";L
193 PRINT "MILAGE CITY,HIWAY...";M;",";N
194 PRINT "% HIWAY MILAGE......";O
196 PRINT "AMOUNT FINANCED..";AF
197 PRINT "YEARS FINANCED...";YF
198 PRINT "FINANCE CHARGE %.";I(2)*100
200 INPUT"ARE THE ABOVE INPUTS CORRECT-Y/N";Z$
201 IF Z$<>"Y" THEN 600
205 GOSUB 300
210 GOSUB 500
211 FC(XX)=FC:PT(XX)=PMT
212 C(1)=EP+PCH-FC:D(XX)=C(1):E(XX)=C(1)/(F*J):FC(XX)=FC
213 C(2)=EP+PCH:F(XX)=C(2):G(XX)=C(2)/(F*J)
217 GOSUB2100
218 PRINT" [146]COST SUMMARY"
219 PRINT"";A$;" ";B$;" ";C$
220 PRINT TAB(26)"[145]$";E
222 PRINT"TOTAL COSTS(NOT FINANCED)$";INT(C(1)*100)/100
224 PRINT"COST PER MILE............$";INT((C(1)/(F*J))*1000)/1000
225 PRINT"MONTHLY PAYMENT..........$";INT(PMT*100)/100
228 PRINT"TOTAL LOAN COST..........$";INT(FC*100)/100
234 PRINT"TOTAL COSTS (FINANCED)...$";INT(C(2)*100)/100
236 PRINT"COST PER MILE............$";INT(C(2)/(F*J)*1000)/1000
238 GOSUB 700
239 PRINT:PRINT:INPUT "DO YOU WISH TO MODIFY A PARAMETER";ZZ$
240 IF ZZ$="Y"THEN XX=XX+1
241 IF ZZ$="Y"THEN GOSUB600
242 GOSUB 800
300 REM*DPN & FINANCE COSTS***
312 REM***VALUE DECREASE***
314 W=E:MM=0:DPN=0
315 FORV=FTO1STEP-1
316 MM=(W/UL)*1.5
318 DPN=DPN+MM:W=E-DPN
320 NEXTV
400 REM*****FINANCE COSTS*****
410 PV=(1-(1/(1+(I(2)/12))^(YF*12)))/(I(2)/12)
415 PMT=(1/PV)*AF:FC=(12*YF*PMT)-AF
440 PCH=DPN+FC
450 RETURN
500 REM*****EXPENDIBLES*******
512 A(1)=J*(O/100)*(1/M)*G:REM**$/YR CITY GAS
514 A(2)=J*((100-O)/100)*G/N:REM**HWY GAS
516 QQ(1)=(1+.01)^F
518 GAS=(A(1)+A(2))*QQ(1)*F
522 OIL=(8*J/6000)*H*(1+.01)^F*F
532 TYR=(J/K)*F*I*4-4*I
542 PTS=35*12*(1+.10)^F*F
552 INS=L*F
562 EP=GAS+OIL+PTS+INS+TYR
565 RETURN
600 REM"***MODIFY PERAMETERS**"
608 PRINT"[147] PARAMETERS"
609 PRINT
610 PRINT "MANUFACTURER.....";A$
612 PRINT "MODEL............";B$
614 PRINT "CAR YEAR.........";C$
618 PRINT "(E)PURCHASE PRICE...";E
620 PRINT "(F)YEARS OF USE,LIFE";F;UL
622 PRINT "(G)GAS PRICE........";G
624 PRINT "(H)OIL PRICE........";H
626 PRINT "(I)TIRE COST........";I
628 PRINT "(K)TIRE LIFE........";K
630 PRINT "(J)MILES/YEAR.......";J
632 PRINT "(L)INSURANCE COST...";L
633 PRINT"(M)CITY/HIWAY MILAGE......";M;",";N
634 PRINT "(O)% HIWAY MILAGE.....";O
636 PRINT"I(2) % LOAN INTEREST RATE.....";I(2)*100
637 PRINT "(AF)AMOUNT FINANCED...";AF
638 PRINT "(YF)YEARS FINANCED...";YF
639 PRINT:IFQ=1THEN 666
640 INPUT"WHAT PARAMETER IS TO BE CHANGED-(LETTER,VALUE)";AA$,BB
641 IF AA$="E" THEN E=BB
642 IF AA$="F" THEN F=BB
643 IF AA$="F" THEN GOSUB 690
644 IF AA$="G" THEN G=BB
645 IF AA$="H" THEN H=BB
646 IF AA$="I" THEN I=BB
647 IF AA$="K" THEN K=BB
648 IF AA$="J" THEN J=BB
649 IF AA$="L" THEN L=BB
650 IF AA$="O" THEN O=BB
651 IF AA$="M" THEN M=BB
652 IF AA$="M" THEN GOSUB 680
653 IF AA$="I(2)" THEN I(2)=BB*.01
654 IF AA$="AF" THEN AF=BB
655 IF AA$="YF" THEN YF=BB
659 IFQ=1THENQ=0:IFQQ=1THEN666
660 GOSUB3000
661 INPUT"[145][145][145]DO YOU WANT TO CHANGE SOMETHING ELSE? (Y/N)";ZX$:GOSUB3000
662 IF ZX$<>"Y"THEN 665
663 INPUT"[145][145][145]WHAT PARAMETER IS TO BE CHANGED-(LETTER,VALUE)";AA$,BB
664 GOTO641
665 Q=1:GOTO600
666 INPUT"OK (Y/N)";Q$
667 QQ=0
668 IFQ$="Y"THEN PRINT
669 IFQ$="Y"THEN 205
670 IF Q$<>"Y"THEN 660
671 RETURN
680 INPUT"[145]HIWAY MPG";N
681 RETURN
690 INPUT"[145]USEFUL LIFE";UL
691 RETURN
700 REM****EXPENDABLES DETAIL****
702 PRINT"EXPENDIBLES....";EP:PRINTTAB(33)"[145]"INT(100*(EP/C(2)));"%"
704 PRINT"GAS............";GAS:PRINTTAB(29)"[145]"INT(100*(GAS/C(2)));"%"
706 PRINT"OIL............";OIL:PRINTTAB(29)"[145]"INT(100*(OIL/C(2)));"%"
708 PRINT"TIRES..........";TYR:PRINTTAB(29)"[145]"INT(100*(TYR/C(2)));"%"
710 PRINT"PARTS..........";PTS:PRINTTAB(29)"[145]"INT(100*(PTS/C(2)));"%"
712 PRINT"INSURANCE......";INS:PRINTTAB(29)"[145]"INT(100*(INS/C(2)));"%"
715 IF I(2)=0 THEN 720
716 PRINT:PRINT"FINANCE CHARGE ";FC:PRINTTAB(33)"[145]"INT(100*(FC/C(2)));"%"
717 PRINT"DEPRECIATION ";DPN:PRINTTAB(33)"[145]"INT(100*(DPN/C(2)));"%"
720 RETURN
800 REM*****ARRAY FOR ALTERNATIVES*****
810 INPUT"[147]DO YOU WANT A SUMMARY OF THE ALTERNATIVES YOU EXAMINED";AA$
812 IF AA$="N" THEN 900
813 PRINT"[147]";"SUMMARY OF ALTERNATIVES[146]"
814 PRINT"ALT","TOTALCOST"," COST/MILE"
816 FOR AAA=1 TO XX
817 PRINTAAA,INT(F(AAA)*100)/100:PRINT TAB(30)"[145]"INT(G(AAA)*1000)/1000
818 NEXT AAA
819 PRINT""
820 PRINT"ALT"," MO PMT "," FINC CHG "
821 FOR AAA=1 TO XX
822 PRINTAAA,INT(PT(AAA)*100)/100:PRINTTAB(30)"[145]"INT(FC(AAA)*100)/100
823 NEXT AAA
824 PRINT""
826 PRINT"THE USEFULNESS OF THE ABOVE DEPENDS ON"
827 PRINT"KNOWING THE PARAMETERS YOU ALTERED!!"
900 END
1000 A$="CHEVORLET"
1001 B$="CAMERO"
1002 C$="1978"
1004 E=5865
1005 F=5:UL=10
1006 G=.63
1007 H=.78
1008 I=35.00
1009 K=30000
1010 J=15000
1011 L=220
1012 M=25
1013 N=29
1014 O=63
1016 XX=1
1017 I(2)=.1106:YF=3:AF=4200
1020 GOTO 150
2000 REM***BOARDER 1***
2001 PRINT"[147]"
2002 T$="[185]":U$="[181]":V$="[182]":S$="[184]"
2004 FOR V=1 TO 39:PRINTT$;:NEXT V:PRINT"[157]
2006 [129] V[178]1 [164] 15:[153]U$;[166]37)V$:[130] V:[153]"CMD
2008 FOR V=1 TO 39:PRINTS$;:NEXTV:PRINT"[157]
2010 [142]
2100 [143]*****BOARDER 2******
2101 [153]"LOAD"
2102 T$[178]"POS":U$[178]"INT":V$[178]"ABS":S$[178]"FRE"
2104 [129] V[178]1 [164] 39:[153]T$;:[130] V:[153]"CMD
2106 FOR V=1 TO 22:PRINTU$;SPC(37)V$:NEXT V:PRINT"[157]
2108 [129] V[178]1 [164] 39:[153]S$;:[130]V:[153]"CMD
2110 RETURN
3000 PRINT"[145][145] "
3001 PRINT"[145] "
3002 RETURN